Namespace - LJCNetCommon
Parameters
type - The object type.
message - The message string.
Returns
The deserialized object.
Syntax
C# |
public static Object XmlDeserializeMessage(Type type, String message)
|
Deserialize an XML message string to an object. (E)
Example
C# |
using LJCNetCommon;
public class Person
{
public long Id { get; set; }
public string Name { get; set; }
public bool PrincipleFlag { get; set; }
}
private static void XmlDeserializeMessage()
{
var person = new Person()
{
Id = 2,
Name = "Text",
PrincipleFlag = true
};
string message = NetCommon.XmlSerializeToString(person.GetType(), person, null);
Person newPerson;
newPerson = NetCommon.XmlDeserializeMessage(typeof(Person), message) as Person;
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.